package cn.it58.gooditname.services

/**
 * 本地翻译词典
 */
class LocalDictionary {
    
    private val dictionary = mutableMapOf<String, String>()
    
    init {
        initializeDictionary()
    }
    
    /**
     * 翻译中文文本
     */
    fun translate(chineseText: String): String {
        return dictionary[chineseText] ?: chineseText
    }
    
    /**
     * 初始化词典
     */
    private fun initializeDictionary() {
        // 基础词汇
        dictionary["用户"] = "user"
        dictionary["获取"] = "get"
        dictionary["创建"] = "create"
        dictionary["删除"] = "delete"
        dictionary["更新"] = "update"
        dictionary["信息"] = "info"
        dictionary["数据"] = "data"
        dictionary["列表"] = "list"
        dictionary["详情"] = "detail"
        dictionary["管理"] = "manage"
        dictionary["管理器"] = "manager"
        dictionary["服务"] = "service"
        dictionary["控制器"] = "controller"
        dictionary["组件"] = "component"
        dictionary["配置"] = "config"
        dictionary["设置"] = "setting"
        dictionary["登录"] = "login"
        dictionary["注册"] = "register"
        dictionary["密码"] = "password"
        dictionary["令牌"] = "token"
        dictionary["会话"] = "session"
        dictionary["权限"] = "permission"
        dictionary["角色"] = "role"
        dictionary["状态"] = "status"
        dictionary["结果"] = "result"
        dictionary["响应"] = "response"
        dictionary["请求"] = "request"
        dictionary["接口"] = "api"
        dictionary["方法"] = "method"
        dictionary["函数"] = "function"
        dictionary["参数"] = "param"
        dictionary["返回"] = "return"
        dictionary["错误"] = "error"
        dictionary["异常"] = "exception"
        dictionary["成功"] = "success"
        dictionary["失败"] = "fail"
        dictionary["开始"] = "start"
        dictionary["结束"] = "end"
        dictionary["时间"] = "time"
        dictionary["日期"] = "date"
        dictionary["名称"] = "name"
        dictionary["标题"] = "title"
        dictionary["内容"] = "content"
        dictionary["描述"] = "description"
        dictionary["类型"] = "type"
        dictionary["分类"] = "category"
        dictionary["标签"] = "tag"
        dictionary["图片"] = "image"
        dictionary["文件"] = "file"
        dictionary["路径"] = "path"
        dictionary["链接"] = "link"
        dictionary["地址"] = "address"
        dictionary["邮箱"] = "email"
        dictionary["电话"] = "phone"
        dictionary["数量"] = "count"
        dictionary["总数"] = "total"
        dictionary["页数"] = "page"
        dictionary["大小"] = "size"
        dictionary["长度"] = "length"
        dictionary["宽度"] = "width"
        dictionary["高度"] = "height"
        dictionary["颜色"] = "color"
        dictionary["样式"] = "style"
        dictionary["主题"] = "theme"
        dictionary["模板"] = "template"
        dictionary["布局"] = "layout"
        dictionary["菜单"] = "menu"
        dictionary["导航"] = "nav"
        dictionary["按钮"] = "button"
        dictionary["表单"] = "form"
        dictionary["输入"] = "input"
        dictionary["输出"] = "output"
        dictionary["显示"] = "display"
        dictionary["隐藏"] = "hide"
        dictionary["打开"] = "open"
        dictionary["关闭"] = "close"
        dictionary["选择"] = "select"
        dictionary["选项"] = "option"
        dictionary["值"] = "value"
        dictionary["默认"] = "default"
        dictionary["当前"] = "current"
        dictionary["新的"] = "new"
        dictionary["旧的"] = "old"
        dictionary["第一个"] = "first"
        dictionary["最后一个"] = "last"
        dictionary["下一个"] = "next"
        dictionary["上一个"] = "prev"
        dictionary["索引"] = "index"
        dictionary["键"] = "key"
        dictionary["标识"] = "id"
        dictionary["编号"] = "number"
        dictionary["代码"] = "code"
        dictionary["版本"] = "version"
        dictionary["启用"] = "enable"
        dictionary["禁用"] = "disable"
        dictionary["激活"] = "active"
        dictionary["可用"] = "available"
        dictionary["公开"] = "public"
        dictionary["私有"] = "private"
        dictionary["内部"] = "internal"
        dictionary["外部"] = "external"
        dictionary["本地"] = "local"
        dictionary["远程"] = "remote"
        dictionary["全局"] = "global"
        dictionary["临时"] = "temp"
        dictionary["缓存"] = "cache"
        dictionary["存储"] = "storage"
        dictionary["数据库"] = "database"
        dictionary["表"] = "table"
        dictionary["字段"] = "field"
        dictionary["行"] = "row"
        dictionary["列"] = "column"
        dictionary["记录"] = "record"
        dictionary["模型"] = "model"
        dictionary["视图"] = "view"
        dictionary["查询"] = "query"
        dictionary["搜索"] = "search"
        dictionary["过滤"] = "filter"
        dictionary["排序"] = "sort"
        dictionary["分组"] = "group"
        dictionary["统计"] = "statistics"
        dictionary["计算"] = "calculate"
        dictionary["处理"] = "process"
        dictionary["操作"] = "operation"
        dictionary["动作"] = "action"
        dictionary["事件"] = "event"
        dictionary["监听"] = "listen"
        dictionary["回调"] = "callback"
        dictionary["通知"] = "notification"
        dictionary["消息"] = "message"
        dictionary["警告"] = "warning"
        dictionary["提示"] = "tip"
        dictionary["帮助"] = "help"
        dictionary["文档"] = "document"
        dictionary["说明"] = "instruction"
        dictionary["规则"] = "rule"
        dictionary["策略"] = "policy"
        dictionary["算法"] = "algorithm"
        dictionary["逻辑"] = "logic"
        dictionary["条件"] = "condition"
        dictionary["判断"] = "judge"
        dictionary["比较"] = "compare"
        dictionary["匹配"] = "match"
        dictionary["验证"] = "validate"
        dictionary["检查"] = "check"
        dictionary["测试"] = "test"
        dictionary["调试"] = "debug"
        dictionary["日志"] = "log"
        dictionary["监控"] = "monitor"
        dictionary["性能"] = "performance"
        dictionary["优化"] = "optimize"
        dictionary["改进"] = "improve"
        dictionary["修复"] = "fix"
        dictionary["问题"] = "issue"
        dictionary["错误"] = "bug"
        dictionary["任务"] = "task"
        dictionary["工作"] = "work"
        dictionary["项目"] = "project"
        dictionary["模块"] = "module"
        dictionary["包"] = "package"
        dictionary["依赖"] = "dependency"
        dictionary["库"] = "library"
        dictionary["框架"] = "framework"
        dictionary["工具"] = "tool"
        dictionary["实用"] = "util"
        dictionary["助手"] = "helper"
        dictionary["扩展"] = "extension"
        dictionary["插件"] = "plugin"
        dictionary["应用"] = "app"
        dictionary["系统"] = "system"
        dictionary["平台"] = "platform"
        dictionary["环境"] = "environment"
        dictionary["开发"] = "develop"
        dictionary["构建"] = "build"
        dictionary["部署"] = "deploy"
        dictionary["发布"] = "release"
        dictionary["版本"] = "version"
        dictionary["分支"] = "branch"
        dictionary["标记"] = "tag"
        dictionary["提交"] = "commit"
        dictionary["推送"] = "push"
        dictionary["拉取"] = "pull"
        dictionary["合并"] = "merge"
        dictionary["冲突"] = "conflict"
        dictionary["解决"] = "resolve"
        dictionary["回滚"] = "rollback"
        dictionary["备份"] = "backup"
        dictionary["恢复"] = "restore"
        dictionary["导入"] = "import"
        dictionary["导出"] = "export"
        dictionary["同步"] = "sync"
        dictionary["异步"] = "async"
        dictionary["线程"] = "thread"
        dictionary["进程"] = "process"
        dictionary["队列"] = "queue"
        dictionary["栈"] = "stack"
        dictionary["堆"] = "heap"
        dictionary["内存"] = "memory"
        dictionary["网络"] = "network"
        dictionary["连接"] = "connection"
        dictionary["协议"] = "protocol"
        dictionary["端口"] = "port"
        dictionary["主机"] = "host"
        dictionary["域名"] = "domain"
        dictionary["证书"] = "certificate"
        dictionary["加密"] = "encrypt"
        dictionary["解密"] = "decrypt"
        dictionary["哈希"] = "hash"
        dictionary["算法"] = "algorithm"
        dictionary["编码"] = "encode"
        dictionary["解码"] = "decode"
        dictionary["压缩"] = "compress"
        dictionary["解压"] = "decompress"
        dictionary["上传"] = "upload"
        dictionary["下载"] = "download"
        dictionary["传输"] = "transfer"
        dictionary["发送"] = "send"
        dictionary["接收"] = "receive"
        dictionary["广播"] = "broadcast"
        dictionary["订阅"] = "subscribe"
        dictionary["发布"] = "publish"
        dictionary["推送"] = "push"
        dictionary["拉取"] = "pull"
        dictionary["刷新"] = "refresh"
        dictionary["重载"] = "reload"
        dictionary["重置"] = "reset"
        dictionary["清空"] = "clear"
        dictionary["删除"] = "delete"
        dictionary["移除"] = "remove"
        dictionary["添加"] = "add"
        dictionary["插入"] = "insert"
        dictionary["修改"] = "modify"
        dictionary["编辑"] = "edit"
        dictionary["保存"] = "save"
        dictionary["加载"] = "load"
        dictionary["初始化"] = "init"
        dictionary["启动"] = "start"
        dictionary["停止"] = "stop"
        dictionary["暂停"] = "pause"
        dictionary["继续"] = "continue"
        dictionary["重启"] = "restart"
        dictionary["退出"] = "exit"
        dictionary["关闭"] = "close"
        dictionary["打开"] = "open"
        dictionary["展开"] = "expand"
        dictionary["折叠"] = "collapse"
        dictionary["显示"] = "show"
        dictionary["隐藏"] = "hide"
        dictionary["切换"] = "toggle"
        dictionary["选中"] = "select"
        dictionary["取消"] = "cancel"
        dictionary["确认"] = "confirm"
        dictionary["提交"] = "submit"
        dictionary["应用"] = "apply"
        dictionary["重试"] = "retry"
        dictionary["跳过"] = "skip"
        dictionary["忽略"] = "ignore"
        dictionary["处理"] = "handle"
        dictionary["执行"] = "execute"
        dictionary["运行"] = "run"
        dictionary["调用"] = "call"
        dictionary["返回"] = "return"
        dictionary["退出"] = "exit"
        dictionary["完成"] = "complete"
        dictionary["成功"] = "success"
        dictionary["失败"] = "failure"
        dictionary["错误"] = "error"
        dictionary["警告"] = "warning"
        dictionary["信息"] = "info"
        dictionary["调试"] = "debug"
        dictionary["追踪"] = "trace"
        dictionary["监控"] = "monitor"
        dictionary["统计"] = "stats"
        dictionary["报告"] = "report"
        dictionary["分析"] = "analysis"
        dictionary["结果"] = "result"
        dictionary["输出"] = "output"
        dictionary["响应"] = "response"
        dictionary["反馈"] = "feedback"
        dictionary["评价"] = "rating"
        dictionary["评论"] = "comment"
        dictionary["回复"] = "reply"
        dictionary["转发"] = "forward"
        dictionary["分享"] = "share"
        dictionary["收藏"] = "favorite"
        dictionary["点赞"] = "like"
        dictionary["关注"] = "follow"
        dictionary["订阅"] = "subscribe"
        dictionary["通知"] = "notify"
        dictionary["提醒"] = "remind"
        dictionary["警报"] = "alert"
        dictionary["消息"] = "message"
        dictionary["邮件"] = "mail"
        dictionary["短信"] = "sms"
        dictionary["电话"] = "call"
        dictionary["视频"] = "video"
        dictionary["音频"] = "audio"
        dictionary["图像"] = "image"
        dictionary["文本"] = "text"
        dictionary["文档"] = "document"
        dictionary["表格"] = "table"
        dictionary["图表"] = "chart"
        dictionary["图形"] = "graph"
        dictionary["界面"] = "interface"
        dictionary["页面"] = "page"
        dictionary["窗口"] = "window"
        dictionary["对话框"] = "dialog"
        dictionary["弹窗"] = "popup"
        dictionary["工具栏"] = "toolbar"
        dictionary["状态栏"] = "statusbar"
        dictionary["侧边栏"] = "sidebar"
        dictionary["菜单栏"] = "menubar"
        dictionary["标签页"] = "tab"
        dictionary["面板"] = "panel"
        dictionary["容器"] = "container"
        dictionary["布局"] = "layout"
        dictionary["网格"] = "grid"
        dictionary["列表"] = "list"
        dictionary["树"] = "tree"
        dictionary["表"] = "table"
        dictionary["表单"] = "form"
        dictionary["字段"] = "field"
        dictionary["标签"] = "label"
        dictionary["输入框"] = "input"
        dictionary["文本框"] = "textbox"
        dictionary["密码框"] = "password"
        dictionary["下拉框"] = "dropdown"
        dictionary["复选框"] = "checkbox"
        dictionary["单选框"] = "radio"
        dictionary["按钮"] = "button"
        dictionary["链接"] = "link"
        dictionary["图片"] = "image"
        dictionary["图标"] = "icon"
        dictionary["头像"] = "avatar"
        dictionary["徽章"] = "badge"
        dictionary["标记"] = "tag"
        dictionary["进度条"] = "progress"
        dictionary["加载"] = "loading"
        dictionary["滚动条"] = "scrollbar"
        dictionary["分页"] = "pagination"
        dictionary["搜索框"] = "searchbox"
        dictionary["过滤器"] = "filter"
        dictionary["排序"] = "sort"
        dictionary["分组"] = "group"
        dictionary["分类"] = "category"
        dictionary["标签"] = "tag"
        dictionary["关键词"] = "keyword"
        dictionary["热门"] = "hot"
        dictionary["推荐"] = "recommend"
        dictionary["最新"] = "latest"
        dictionary["最热"] = "hottest"
        dictionary["精选"] = "featured"
        dictionary["相关"] = "related"
        dictionary["相似"] = "similar"
        dictionary["其他"] = "other"
        dictionary["更多"] = "more"
        dictionary["全部"] = "all"
        dictionary["无"] = "none"
        dictionary["空"] = "empty"
        dictionary["未知"] = "unknown"
        dictionary["默认"] = "default"
        dictionary["自定义"] = "custom"
        dictionary["配置"] = "config"
        dictionary["设置"] = "settings"
        dictionary["选项"] = "options"
        dictionary["首选项"] = "preferences"
        dictionary["属性"] = "properties"
        dictionary["参数"] = "parameters"
        dictionary["变量"] = "variable"
        dictionary["常量"] = "constant"
        dictionary["函数"] = "function"
        dictionary["方法"] = "method"
        dictionary["类"] = "class"
        dictionary["对象"] = "object"
        dictionary["实例"] = "instance"
        dictionary["接口"] = "interface"
        dictionary["枚举"] = "enum"
        dictionary["结构"] = "struct"
        dictionary["联合"] = "union"
        dictionary["模块"] = "module"
        dictionary["包"] = "package"
        dictionary["命名空间"] = "namespace"
        dictionary["作用域"] = "scope"
        dictionary["上下文"] = "context"
        dictionary["环境"] = "environment"
        dictionary["配置"] = "configuration"
        dictionary["初始化"] = "initialization"
        dictionary["构造"] = "constructor"
        dictionary["析构"] = "destructor"
        dictionary["继承"] = "inherit"
        dictionary["实现"] = "implement"
        dictionary["重写"] = "override"
        dictionary["重载"] = "overload"
        dictionary["多态"] = "polymorphism"
        dictionary["封装"] = "encapsulation"
        dictionary["抽象"] = "abstract"
        dictionary["具体"] = "concrete"
        dictionary["虚拟"] = "virtual"
        dictionary["静态"] = "static"
        dictionary["动态"] = "dynamic"
        dictionary["同步"] = "synchronous"
        dictionary["异步"] = "asynchronous"
        dictionary["并发"] = "concurrent"
        dictionary["并行"] = "parallel"
        dictionary["串行"] = "serial"
        dictionary["顺序"] = "sequential"
        dictionary["随机"] = "random"
        dictionary["排序"] = "sorted"
        dictionary["索引"] = "indexed"
        dictionary["映射"] = "mapped"
        dictionary["过滤"] = "filtered"
        dictionary["分组"] = "grouped"
        dictionary["聚合"] = "aggregated"
        dictionary["累积"] = "accumulated"
        dictionary["计算"] = "computed"
        dictionary["生成"] = "generated"
        dictionary["转换"] = "converted"
        dictionary["解析"] = "parsed"
        dictionary["序列化"] = "serialized"
        dictionary["反序列化"] = "deserialized"
        dictionary["编码"] = "encoded"
        dictionary["解码"] = "decoded"
        dictionary["压缩"] = "compressed"
        dictionary["解压"] = "decompressed"
        dictionary["加密"] = "encrypted"
        dictionary["解密"] = "decrypted"
        dictionary["签名"] = "signed"
        dictionary["验证"] = "verified"
        dictionary["认证"] = "authenticated"
        dictionary["授权"] = "authorized"
        dictionary["登录"] = "loggedIn"
        dictionary["注销"] = "logout"
        dictionary["会话"] = "session"
        dictionary["令牌"] = "token"
        dictionary["密钥"] = "key"
        dictionary["证书"] = "certificate"
        dictionary["凭据"] = "credentials"
        dictionary["身份"] = "identity"
        dictionary["用户"] = "user"
        dictionary["账户"] = "account"
        dictionary["配置文件"] = "profile"
        dictionary["角色"] = "role"
        dictionary["权限"] = "permission"
        dictionary["策略"] = "policy"
        dictionary["规则"] = "rule"
        dictionary["限制"] = "restriction"
        dictionary["约束"] = "constraint"
        dictionary["验证"] = "validation"
        dictionary["检查"] = "check"
        dictionary["测试"] = "test"
        dictionary["调试"] = "debug"
        dictionary["监控"] = "monitoring"
        dictionary["日志"] = "logging"
        dictionary["追踪"] = "tracing"
        dictionary["性能"] = "performance"
        dictionary["优化"] = "optimization"
        dictionary["缓存"] = "caching"
        dictionary["存储"] = "storage"
        dictionary["数据库"] = "database"
        dictionary["备份"] = "backup"
        dictionary["恢复"] = "recovery"
        dictionary["迁移"] = "migration"
        dictionary["同步"] = "synchronization"
        dictionary["复制"] = "replication"
        dictionary["分片"] = "sharding"
        dictionary["分区"] = "partitioning"
        dictionary["索引"] = "indexing"
        dictionary["查询"] = "querying"
        dictionary["搜索"] = "searching"
        dictionary["排序"] = "sorting"
        dictionary["分组"] = "grouping"
        dictionary["聚合"] = "aggregation"
        dictionary["统计"] = "statistics"
        dictionary["分析"] = "analytics"
        dictionary["报告"] = "reporting"
        dictionary["仪表板"] = "dashboard"
        dictionary["图表"] = "charts"
        dictionary["可视化"] = "visualization"
        dictionary["展示"] = "presentation"
        dictionary["界面"] = "ui"
        dictionary["体验"] = "experience"
        dictionary["交互"] = "interaction"
        dictionary["响应"] = "responsive"
        dictionary["自适应"] = "adaptive"
        dictionary["移动端"] = "mobile"
        dictionary["桌面端"] = "desktop"
        dictionary["网页"] = "web"
        dictionary["应用"] = "application"
        dictionary["服务"] = "service"
        dictionary["接口"] = "api"
        dictionary["端点"] = "endpoint"
        dictionary["路由"] = "route"
        dictionary["中间件"] = "middleware"
        dictionary["过滤器"] = "filter"
        dictionary["拦截器"] = "interceptor"
        dictionary["处理器"] = "handler"
        dictionary["控制器"] = "controller"
        dictionary["服务"] = "service"
        dictionary["仓库"] = "repository"
        dictionary["模型"] = "model"
        dictionary["实体"] = "entity"
        dictionary["值对象"] = "valueObject"
        dictionary["数据传输对象"] = "dto"
        dictionary["视图模型"] = "viewModel"
        dictionary["工厂"] = "factory"
        dictionary["构建器"] = "builder"
        dictionary["单例"] = "singleton"
        dictionary["原型"] = "prototype"
        dictionary["适配器"] = "adapter"
        dictionary["装饰器"] = "decorator"
        dictionary["代理"] = "proxy"
        dictionary["观察者"] = "observer"
        dictionary["发布者"] = "publisher"
        dictionary["订阅者"] = "subscriber"
        dictionary["命令"] = "command"
        dictionary["策略"] = "strategy"
        dictionary["状态"] = "state"
        dictionary["模板"] = "template"
        dictionary["访问者"] = "visitor"
        dictionary["迭代器"] = "iterator"
        dictionary["组合"] = "composite"
        dictionary["外观"] = "facade"
        dictionary["桥接"] = "bridge"
        dictionary["享元"] = "flyweight"
        dictionary["原型"] = "prototype"
        dictionary["抽象工厂"] = "abstractFactory"
        dictionary["工厂方法"] = "factoryMethod"
        dictionary["建造者"] = "builder"
        dictionary["单例"] = "singleton"
        dictionary["责任链"] = "chainOfResponsibility"
        dictionary["解释器"] = "interpreter"
        dictionary["中介者"] = "mediator"
        dictionary["备忘录"] = "memento"
        dictionary["空对象"] = "nullObject"
        dictionary["前端控制器"] = "frontController"
        dictionary["业务代表"] = "businessDelegate"
        dictionary["组合实体"] = "compositeEntity"
        dictionary["数据访问对象"] = "dataAccessObject"
        dictionary["服务定位器"] = "serviceLocator"
        dictionary["传输对象"] = "transferObject"
        dictionary["模型视图控制器"] = "mvc"
        dictionary["模型视图展示器"] = "mvp"
        dictionary["模型视图视图模型"] = "mvvm"
    }
} 